package com.azt.api.pojo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.azt.pojo.BaseEntity;

@Table(name = "u_integral_rule")
public class IntegralRule extends BaseEntity {
	
	@Column(name="title")
    private String title;
	
	@Column(name="descr")
    private String descr;
	
	@Column(name="score")
    private Double score;
	
	@Column(name="type")
    private Integer type;
	
	@Column(name="operateType")
    private Integer operateType;
	
	@Column(name="ruleCode")
    private String ruleCode;
	
	@Column(name="removed")
    private Integer removed;
	
	@Column(name="pid")
	private Integer pid;
	
	@Column(name="scorelimit")
	private Integer scorelimit;
	
	@Column(name="hasTemplate")
	private String hasTemplate;
	
	@Column(name="disTemplate")
	private String disTemplate;
	
	
	public String getHasTemplate() {
		return hasTemplate;
	}

	public void setHasTemplate(String hasTemplate) {
		this.hasTemplate = hasTemplate;
	}

	public String getDisTemplate() {
		return disTemplate;
	}

	public void setDisTemplate(String disTemplate) {
		this.disTemplate = disTemplate;
	}

	public Integer getPid() {
		return pid;
	}

	public void setPid(Integer pid) {
		this.pid = pid;
	}

	public Integer getScorelimit() {
		return scorelimit;
	}

	public void setScorelimit(Integer scorelimit) {
		this.scorelimit = scorelimit;
	}

	public void setScoreval(String scoreval) {
		this.scoreval = scoreval;
	}

	@Transient
	private String scoreval;
	
    public String getScoreval() {
    	if(this.score!=null){
    		if(this.type.equals(1)){
        		return this.score+"";
        	}else{
        		return this.score*100+"%";
        	}
    	}else{
    		return "";
    	}
	}

	public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public String getDescr() {
        return descr;
    }

    public void setDescr(String descr) {
        this.descr = descr == null ? null : descr.trim();
    }

    public Double getScore() {
        return score;
    }

    public void setScore(Double score) {
        this.score = score;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getOperateType() {
        return operateType;
    }

    public void setOperateType(Integer operateType) {
        this.operateType = operateType;
    }

    public String getRuleCode() {
        return ruleCode;
    }

    public void setRuleCode(String ruleCode) {
        this.ruleCode = ruleCode == null ? null : ruleCode.trim();
    }

    public Integer getRemoved() {
        return removed;
    }

    public void setRemoved(Integer removed) {
        this.removed = removed;
    }

}